﻿<Fluent:RibbonWindow x:Class="DaxStudio.UI.Views.ShellView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:Fluent="clr-namespace:Fluent;assembly=Fluent" 
        xmlns:DAXEditor="clr-namespace:DAXEditor;assembly=DAXEditor" 
        xmlns:avalondock="http://schemas.xceed.com/wpf/xaml/avalondock" 
        xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
        xmlns:cal="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro.Platform"
        xmlns:tb="http://www.hardcodet.net/taskbar"       
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:DaxStudio.UI.Utils" 
        xmlns:conv="clr-namespace:DaxStudio.UI.Converters"
        mc:Ignorable="d" 
        d:DesignWidth="466" 
                     
        Icon="pack://application:,,,/DaxStudio.UI;component/images/DaxStudio.ico"    
        ResizeMode="CanResizeWithGrip"
        Style="{DynamicResource MetroWindowStyle}"
        MinHeight="400"
        MinWidth="400"                    
        Height="720"
        Width="1120"
        Top="5"
        >
    <!--Fluent:MetroColors.ThemeColorKey="#FF0072C6"-->
    <Fluent:RibbonWindow.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <!--<ResourceDictionary Source="/Fluent;Component/Themes/Generic.xaml" />
                <ResourceDictionary Source="/Fluent;Component/Themes/Metro/White.xaml" />-->
                <ResourceDictionary Source="pack://application:,,,/Fluent;component/Themes/Office2013/Generic.xaml"/>
                <!--<ResourceDictionary Source="/DaxStudio;Component/Themes/Colors.xaml" />
                <ResourceDictionary Source="/DaxStudio;Component/Themes/ColorsWhite.xaml" />-->
                <!--<ResourceDictionary Source="/Fluent;Component/Themes/Office2010/Silver.xaml" />-->
                <ResourceDictionary  Source="pack://application:,,,/DaxStudio.UI;Component/Resources/IconResourceDictionary.xaml" />
                <ResourceDictionary  Source="pack://application:,,,/DaxStudio.UI;Component/Resources/DaxStudioResources.xaml" />
                <ResourceDictionary Source="/DAXEditor;Component/Themes/Generic.xaml" />
            </ResourceDictionary.MergedDictionaries>

            <!--
            <Color x:Key="{x:Static Fluent:MetroColors.ThemeColorKey}">#FF0072C6</Color>
            <SolidColorBrush x:Key="DaxStudioBrush" Color="#FF0072C6" />
            
            
            <Style x:Key="MetroComboBox"  TargetType="{x:Type ComboBox}">
                <Setter Property="HorizontalAlignment" Value="Stretch"/>
                <Setter Property="VerticalAlignment" Value="Top"/>
                <Setter Property="MinWidth" Value="60"/>
                <Setter Property="UIElement.SnapsToDevicePixels" Value="True"/>
                <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
                <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
                <Setter Property="ScrollViewer.CanContentScroll" Value="True"/>
                <Setter Property="TextElement.Foreground" Value="Black"/>
                <Setter Property="FrameworkElement.FocusVisualStyle" Value="{x:Null}"/>
                <Setter Property="BorderBrush" Value="LightGray"/>
                <Setter Property="BorderThickness" Value="1" />
                <Setter Property="Background" Value="White" />
            </Style>
            -->
            
        <!--<DataTemplate x:Key="DragAdorner">
            <Border Background="Silver"
                    BorderBrush="Gray"
                    BorderThickness="1"
                    CornerRadius="2"
                    Margin="1">
                <StackPanel Orientation="Horizontal">
                    <Image Source="/icon.png"
                           Width="16"
                           Margin="0,0,2,0"
                           VerticalAlignment="Center" />
                    <TextBlock Text="{Binding}"
                               Margin="0,0,2,0"
                               VerticalAlignment="Center" />
                </StackPanel>
            </Border>
        </DataTemplate>-->
        </ResourceDictionary>
    </Fluent:RibbonWindow.Resources>
    
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="ContentRendered">
            <cal:ActionMessage MethodName="ContentRendered" />
        </i:EventTrigger>

        <local:InputBindingTrigger>
            <local:InputBindingTrigger.InputBinding>
                <KeyBinding  Key="F5"/>
            </local:InputBindingTrigger.InputBinding>
            <cal:ActionMessage MethodName="RunQuery"/>
        </local:InputBindingTrigger>

        <local:InputBindingTrigger>
            <local:InputBindingTrigger.InputBinding>
                <KeyBinding  Key="X" Modifiers="Alt"/>
            </local:InputBindingTrigger.InputBinding>
            <cal:ActionMessage MethodName="RunQuery"/>
        </local:InputBindingTrigger>

        <local:InputBindingTrigger>
            <local:InputBindingTrigger.InputBinding>
                <KeyBinding   Key="N" Modifiers="Control"/>
            </local:InputBindingTrigger.InputBinding>
            <cal:ActionMessage MethodName="NewDocument"/>
        </local:InputBindingTrigger>

        <local:InputBindingTrigger>
            <local:InputBindingTrigger.InputBinding>
                <KeyBinding   Key="O" Modifiers="Control"/>
            </local:InputBindingTrigger.InputBinding>
            <cal:ActionMessage MethodName="OpenDocument"/>
        </local:InputBindingTrigger>

        <local:InputBindingTrigger>
            <local:InputBindingTrigger.InputBinding>
                <KeyBinding   Key="S" Modifiers="Control"/>
            </local:InputBindingTrigger.InputBinding>
            <cal:ActionMessage MethodName="SaveCurrentDocument"/>
        </local:InputBindingTrigger>

        <local:InputBindingTrigger>
            <local:InputBindingTrigger.InputBinding>
                <KeyBinding   Key="U" Modifiers="Control+Shift"/>
            </local:InputBindingTrigger.InputBinding>
            <cal:ActionMessage MethodName="SelectionToUpper"/>
        </local:InputBindingTrigger>
        <local:InputBindingTrigger>
            <local:InputBindingTrigger.InputBinding>
                <KeyBinding   Key="L" Modifiers="Control+Shift"/>
            </local:InputBindingTrigger.InputBinding>
            <cal:ActionMessage MethodName="SelectionToLower"/>
        </local:InputBindingTrigger>

        <local:InputBindingTrigger>
            <local:InputBindingTrigger.InputBinding>
                <KeyBinding  Key="U" Modifiers="Control+Alt"/>
            </local:InputBindingTrigger.InputBinding>
            <cal:ActionMessage MethodName="UncommentSelection"/>
        </local:InputBindingTrigger>
        
        <local:InputBindingTrigger>
            <local:InputBindingTrigger.InputBinding>
                <KeyBinding  Key="C" Modifiers="Control+Alt"/>
            </local:InputBindingTrigger.InputBinding>
            <cal:ActionMessage MethodName="CommentSelection"/>
        </local:InputBindingTrigger>

        <local:InputBindingTrigger>
            <local:InputBindingTrigger.InputBinding>
                <KeyBinding  Key="Y" Modifiers="Control"/>
            </local:InputBindingTrigger.InputBinding>
            <cal:ActionMessage MethodName="Redo"/>
        </local:InputBindingTrigger>

        <local:InputBindingTrigger>
            <local:InputBindingTrigger.InputBinding>
                <KeyBinding  Key="Z" Modifiers="Control"/>
            </local:InputBindingTrigger.InputBinding>
            <cal:ActionMessage MethodName="Undo"/>
        </local:InputBindingTrigger>

        <local:InputBindingTrigger>
            <local:InputBindingTrigger.InputBinding>
                <KeyBinding  Key="Delete" Modifiers="Alt"/>
            </local:InputBindingTrigger.InputBinding>
            <cal:ActionMessage MethodName="Undo"/>
        </local:InputBindingTrigger>

        <local:InputBindingTrigger>
            <local:InputBindingTrigger.InputBinding>
                <KeyBinding  Key="F3" />
            </local:InputBindingTrigger.InputBinding>
            <cal:ActionMessage MethodName="Find"/>
        </local:InputBindingTrigger>

        <local:InputBindingTrigger>
            <local:InputBindingTrigger.InputBinding>
                <KeyBinding  Key="F3" Modifiers="Shift"/>
            </local:InputBindingTrigger.InputBinding>
            <cal:ActionMessage MethodName="FindPrev"/>
        </local:InputBindingTrigger>

        <local:InputBindingTrigger>
            <local:InputBindingTrigger.InputBinding>
                <KeyBinding  Key="F6" />
            </local:InputBindingTrigger.InputBinding>
            <cal:ActionMessage MethodName="FormatQuery"/>
        </local:InputBindingTrigger>
        
    </i:Interaction.Triggers>

    <Grid x:Name="LayoutRoot"
          Margin="0,0,0,-2">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        
        <ContentControl x:Name="Ribbon"
                        Grid.Row="0"/>
        <ContentControl x:Name="Tabs"      
                        Grid.Row="1"/>
        <ContentControl x:Name="StatusBar" 
                        Grid.Row="2"
                        HorizontalAlignment="Stretch"
                        VerticalAlignment="Bottom"/>
        
        
    </Grid>

</Fluent:RibbonWindow>